# -*- encoding:utf-8 -*-
# @Time: 2022/11/23 23:42
# @Author: qiujixian
# @Email: 1253598817@qq.com
# @File: serializers.py
# @Software: PyCharm

from django.contrib.auth.models import User
from rest_framework.serializers import ModelSerializer

class UserSerializer(ModelSerializer):

    class Meta:
        model = User
        exclude = ['password', 'last_name']

    extra_kwargs = {
        'id': {'read_only': True},
        'last_login': {'read_only': True},
        'is_superuser': {'read_only': True},
        'is_staff': {'read_only': True},
        'is_active': {'read_only': True},
        'groups': {'read_only': True},
        'date_joined': {'read_only': True},
    }
